import { get, post } from './request'

//楼层信息
export async function getBuilding(serial) {
  return get(`/v1/building/statistics?building_id=${serial}`).then((res) => res && res.data)
}

export async function getRack(id) {
  return get(`/v1/equipment_view_info/${id}?towards=0`).then((res) => res && res.data)
}

export async function getWebParkcabinetCount(id) {
  return get(`/v1/park/getWebParkCabinetCount?id=${id}`).then((res) => res && res.data)
}


// 获取设备数据 ，点位等

export async function get_equipment(id, towards) {
    /*return request({
        url: "/v1/equipment_view_info/" + id + "?towards=" + towards,    // /equipment_view_info/${id}?towards=0
        method: 'get'
    })
        */

    return get("/v1/equipment_view_info/" + id + "?towards=" + towards).then((res) => res && res.data)
}


export async function getImageBlob(url) {
  // 这里可以传入请求配置，设置 responseType
  return get(url, {
    responseType: 'blob'
  }).then(res => res && res.data)
}